<?php session_start();
include_once 'data/usercheck.php';
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>Food Online</title>
	<link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />
    <style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
    </style>
</head>
<body>
<div id="wrapper">
<div id="logo">
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <table width="200" border="0" align="center">
    <tr>
      <td height="30"><FONT size="+6">
        <div align="center">STMS</div></td>
    </tr>
    <tr>
      <td><div align="center">STUDENT MANAGEMENT SYSTEM</div></td>
    </tr>
</table>
  <p>&nbsp;</p>
</div>
    <div id="nav">
      <div id="nav-left">
        <ul>
          <li><a href="view.php">Home</a></li>
          <li class="orange">
            <div align="left"><a href="http://localhost/stms/pages/data/logout.php">Logout-<?php include_once 'data/databaseconnection.php';session_start();echo $_SESSION['username'];?></a></div>
          </li>
        </ul>
      </div>
      <div id="nav-right">
        <ul>
         
           <li><a href="Aboutus.php">About us</a></li>
          <li><a href="viewhome.php">View</a></li>
          <li><a href="Adminhome.php">Admin</a></li>
          <li><a href="http://www.freewebsitetemplates.com">Contact</a></li>
        </ul>
      </div>
      <div align="right"></div>
    </div>
    <div id="body">
    
      <div align="right"><a href="changepass.php">changepassword</a></div>
      <div class="clear">&nbsp;
        <form id="form1" method="post" action="">
          <p>
            <label for="textfield"><a href="view.php">Show</a></label> 
            <a href="combinationview.php">Combination</a> <a href="resultview.php">Results</a> <a href="">Attendence</a></p>
          <p><font size="+1">Basic Details</font> </p>
		  <?php
		  
		  require_once 'data/databaseconnection.php';
		  
		   
		   $pass1=$_SESSION['password'];
		   $pass=md5($pass1);
		   $user=$_SESSION['username'];
		   //$a=mysql_query("SELECT*FROM user WHERE password='$pass' AND username='$user'");
		
			//$a=mysql_query("SELECT Regno FROM user WHERE password='$pass' AND username='$user' LEFT JOIN SELECT Regno FROM basicdetails ");
		$a=mysql_query("SELECT *FROM basicdetails WHERE Regno in (SELECT Regno FROM user WHERE Password='$pass')");
		// echo mysql_num_rows($a);
		
    if (!$a) {
        die('Invalid query: ' . mysql_error());
    }
		 
		 // $b=mysql_query("SELECT * FROM basicdetails WHERE Regno='$reg'");
			//while($row2=mysql_fetch_array($b)&&$row1=mysql_fetch_array($a))
			
			
				//if($row1['Regno']==$row2['Regno'])
				//if($a['Regno']==$b['Regno'])
				if (mysql_num_rows($a) == 1)
				{
				
			echo "<table border=1  >";
			echo "<tr>";
			echo "<td>Regno</th>";
			echo "<th >Title</th>";
			echo "<th>Firstname</th>";
			echo "<th>Lastname</th>";
			echo "<th>NICno</th>";
			echo "<th>Gender</th>";
			echo "<th>Civilstatus</th>";
			echo "<th>DOB</th>";
			echo "<th>Nationality</th>";
			echo "<th>Religion</th>"; 
			
			
			
			
			
			//$result=mysql_query($a);
			while($row=mysql_fetch_array($a))
			{
				echo "<tr><td>".$row['Regno'];
				echo "<td>".$row['Title'];
				echo "<td>".$row['Firstname'];
				echo "<td>".$row['Lastname'];
				echo "<td>".$row['NICno'];
				echo "<td>".$row['Gender'];
				echo "<td>".$row['Civilstatus'];
				echo "<td>".$row['DOB'];
				echo "<td>".$row['Nationality'];
				echo "<td>".$row['Religion']; 
				echo "</tr>";
			}
			echo "</table>";
			
			echo "<table border=1>";
			echo "<tr>";
			echo "<td>Permanentaddress</th>";
			echo "<th>Temporaryaddress </th>";
			echo "<th>Faculty</th>";
			echo "<th>CourseOfStudy </th>";
			echo "<th>AcademicYear</th>";
			echo "<th>District</th>";
			echo "<br>";echo "<br>";echo "<br>";echo "<br>";echo "<br>";
			
			//$result=mysql_query("SELECT * FROM basicdetails");
			$a=mysql_query("SELECT *FROM basicdetails WHERE Regno in (SELECT Regno FROM user WHERE Password='$pass')");
			while($row=mysql_fetch_array($a))
			{
				echo "<tr><td>".$row['Permanentaddress'];
				echo "<td>".$row['Temporaryaddress'];
				echo "<td>".$row['Faculty'];
				echo "<td>".$row['CourseOfStudy'];
				echo "<td>".$row['AcademicYear'];
				echo "<td>".$row['District'];
				echo "</tr>";
			}
			echo "</table>";
			
			}
			
		  ?>
		  <!--
		  <table width="750" border="1">
            <tr>
              <th scope="row">&nbsp;</th>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <th scope="row">&nbsp;</th>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <th scope="row">&nbsp;</th>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <th scope="row">&nbsp;</th>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <th scope="row">&nbsp;</th>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
            </tr>
          </table>
		  -->
          <p>&nbsp;</p>
          <p>&nbsp; </p>
          <p>
            <label for="textfield"></label><font size="+1">
          G.C.E A/L</font> </p>
          <?php
		  require_once 'data/databaseconnection.php';
			echo "<table border=1>";
			echo "<tr>";
			echo "<th>Regno</th>";
			echo "<th>Indexno</th>";
			echo "<th>Year</th>";
			echo "<th>School</th>";
			echo "<th>District </th>";
			echo "<th>Stream</th>";
			echo "<th>Subject</th>";
			echo "<th>Result </th>";
			echo "<th>Zscore</th>";
			echo "<th>DistrictRank</th>";
			echo "<th>IslandRank</th>";
			
			$result=mysql_query("SELECT * FROM gcealdetails WHERE Regno in (SELECT Regno FROM user WHERE Password='$pass')");
			while($row=mysql_fetch_array($result))
			{
				echo "<tr><td>".$row['Regno'];
				echo "<td>".$row['Indexno'];
				echo "<td>".$row['Year'];
				echo "<td>".$row['School'];
				echo "<td>".$row['District'];
				echo "<td>".$row['Stream'];
				echo "<td>".$row['Subject'];
				echo "<td>".$row['Result'];
				echo "<td>".$row['Zscore'];
				echo "<td>".$row['DistrictRank'];
				echo "<td>".$row['IslandRank'];
				echo "</tr>";
			}
			echo "</table>";
		  ?>
          <p>&nbsp;</p>
        </form>
      </div>
      <div id="footer">
        <ul>
          <li><a href="http://www.freewebsitetemplates.com">Home</a> | </li>
          <li><a href="Aboutus.php">About Us</a> | </li>
          <li><a href="http://www.freewebsitetemplates.com">Menu</a> | </li>
          <li><a href="http://www.freewebsitetemplates.com">Contact</a></li>
        </ul>
        <p>copyright &copy; stms company</p>
      </div>
  </div>
</div>
</body>
</html>
